<?php

namespace Happy\CommandsService\RabbitMQ;

abstract class BasicReciever
{
    protected string $host;

    protected int $port;

    protected string $user;

    protected string $password;

    protected array $queues = [];

    protected string $activeQueue;

    protected $connection;

    protected $channel;

    protected RabbitMqManager $manager;

    public function __construct($host, $port, $user, $password, $manager)
    {
        $this->host = $host;
        $this->port = $port;
        $this->user = $user;
        $this->password = $password;
        $this->manager = $manager;
        $this->createConnection($this->host, $this->port, $this->user, $this->password);
    }

    abstract public function createConnection($host, $port, $user, $password);

    abstract public function changeQueue(string $queueName);

    abstract public function listen($callback);

    abstract public function close();
}
